package com.yycwxt.modules.admin.subcompare;

import com.yycwxt.common.ReturnResult;
import com.yycwxt.domain.SubCompare;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

@Api
@RestController
@Validated
@RequestMapping("/subcompares")
public class SubConpareController {

    private SubCompareService service;

    @Autowired
    public SubConpareController(SubCompareService service) {
        this.service = service;
    }

    @PostMapping()
    @ApiOperation("根据所选科目查询")
    public ReturnResult getsubcompare(@RequestBody SubCompare sub){
        return ReturnResult.buildSuccessResult(service.subcompare(sub));

    }

//    @PostMapping("test")
//    public void test(@RequestBody Object a){
//        System.out.println(a);
//    }

    @GetMapping
    @ApiOperation("获取流水表店铺名称")
    public ReturnResult getshops(){
        return ReturnResult.buildSuccessResult(service.getshops());
    }
}
